//医疗影像

import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:oral_cloud/config/downloader_manager.dart';

class MedicalImaging {

  String name;//影像名称
  int count;//帧数
  int type;//类型
  String group;//
  String path;//下载路径
  String thumb;//影像缩略图
  List<dynamic> imageList;//影像图片数组
  MedicalImageStatus reqStatus=MedicalImageStatus.undefined;//表示请求下载链接的状态

  String filename;
  String savedDir;
  int progress = 0;
  DownloadTaskStatus status = DownloadTaskStatus.undefined;//下载状态



  MedicalImaging.fromJsonMap(Map<String, dynamic> map):
        name = map["name"],
        count = map["count"],
        type = map["type"],
        group = map["group"],
        path = map["compressFile"],
        thumb = map["thumb"],
        imageList = map["imageList"];

  MedicalImaging.parseJson(Map<String, dynamic> map){
    name = map["name"];
    count = map["count"];
    type = map["type"];
    group = map["group"];
    path = map["compressFile"];
    thumb = map["thumb"];
    imageList = map["imageList"];
  }


  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = name;
    data['count'] = count;
    data['type'] = type;
    data['group'] = group;
    data['compressFile'] = path;
    data['thumb'] = thumb;
    data['imageList'] = imageList;
    return data;
  }

  @override
  String toString() {
    return 'MedicalImaging{progress: $progress, status: $status,name: $name, count: $count, type: $type, group: $group, path: $path, thumb: $thumb, imageList: $imageList}';
  }


}

class MedicalImageStatus{
  final int _value;
  const MedicalImageStatus(int value) : _value = value;
  static MedicalImageStatus from(int value) => MedicalImageStatus(value);

  static const undefined = const MedicalImageStatus(0);
  static const progressing = const MedicalImageStatus(1);
  static const completed = const MedicalImageStatus(2);
  static const failed = const MedicalImageStatus(3);
}